public class tect {
    public static void main(String[] args) {
        System.out.println(5+2);//7
        System.out.println(5-2);//3
        System.out.println(5*2);//10
        System.out.println(5/2);//2
        System.out.println(5%2);//1


        System.out.println(5/2);//2
        System.out.println((float)5/2);//2.5
        System.out.println(5/(float)2);//2.5
        System.out.println((float)(5-2));//2.0


        System.out.println(10%3);//1
        System.out.println(10%-3);//1
        System.out.println(-10%3);//-1
        System.out.println(-10%-3);//-1

        short sh=2;
        //sh=sh+2;  会报错，2默认int类型
        sh+=2;//+=会自动帮我们进行类型转换
        System.out.println(sh);//4

        int a=3;
        a++;//a=4
        int a2=3;
        int b=a2++;//b=3  a2=4
        int b2=++a2;//a2=4  b2=4

        int c=10;
        //System.out.println(3<10<100);会报错，不能编译

        int d=1;
        int e=2;
        System.out.println(d==1&&e==2);
        System.out.println(d==2&&e==2);

        System.out.println(d==2&&(1/0)==0);//输出false，不会报错，因为a==2是false，所以不会执行（1/0）==0


    }
}
